class Person:
    def __init__(self, name, age, **kwargs):
        super().__init__(**kwargs)  # 关键：传递剩余参数给下一个父类
        self.name = name
        self.age = age
        print(f"Person {name} 初始化")

class Student(Person):
    def __init__(self, student_id, **kwargs):
        super().__init__(**kwargs)  # 传递参数给 Person
        self.student_id = student_id
        print(f"学生 {self.name} (学号:{student_id}) 初始化")

class Teacher(Person):
    def __init__(self, subject, **kwargs):
        super().__init__(**kwargs)  # 传递参数给 Person
        self.subject = subject
        print(f"老师 {self.name} (科目:{subject}) 初始化")

class TeachingAssistant(Student, Teacher):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)  # 按 MRO 链调用 Student → Teacher → Person
        print(f"助教 {self.name} 初始化完成")

# 创建实例（统一通过关键字参数传递）
ta = TeachingAssistant(
    name="张三",
    age=22,
    student_id="S12345",
    subject="计算机科学"
)

# 验证属性
print(ta.name)        # 张三
print(ta.age)         # 22
print(ta.student_id)  # S12345
print(ta.subject)     # 计算机科学

# 查看 MRO 顺序
print(TeachingAssistant.__mro__)
# 输出: TeachingAssistant → Student → Teacher → Person → object